Time Dependent Regular Expression - regexp

A regular expression on the basis of the following operators can be defined in [] . The function TPT.regexp() returns each interval where the expression is true. Otherwise, if no interval is found, the function’s result is undefined.

This element is the basis of regular expressions. In the simplest case a time dependent logical expression is specified in brackets.

Optionally the minimum time of the matching intervals can be specified in curly braces. If the operation e is true in a given interval but is only true for a time shorter than min, it does not match.

Also a minimum and maximum time can be specified in curly braces. Only intervals of a minimum length will match. If the interval is longer than the maximum specified, it will be set at the maximum.

Example

iv = TPT.Boolean()

iv := TPT.regexp([(t >= 1 and t < 2) or (t >= 4 and t < 7)])

# iv is defined in the interval [1,2) and [4,7)

iv = TPT.Boolean()
iv := TPT.regexp([(t >= 1 and t < 2) or (t >= 4 and t < 7)]{2})
# iv is defined only in the interval [4,7) because [1,2) is shorter than 2

iv = TPT.Boolean()
iv := TPT.regexp([(t >= 1 and t < 2) or (t >= 4 and t < 9)]{2,2})
# iv is defined in the interval [4,6) and [6,8)
# it is cut in 2 intervals with length 2

Any structure like [c(t)==X] used within interval calculation corresponds to one interval, formed by an arbitrary number of many consecutive samples where the condition is fulfilled.
The different intervals in the following examples will be referred as i1, i2, i3, i4, etc.
For example: ([c(t) == 1]([c(t) == 2][c(t) == 3])*[c(t) == 4] where:
[c(t) == 1] is i1
[c(t) == 2] is i2
[c(t) == 3] is i3
[c(t) == 4] is i4